package com.tao.order.feign.fallback;

import com.tao.order.feign.ProductFeignClient;
import com.tao.product.bean.Product;
import org.springframework.stereotype.Component;

import java.math.BigDecimal;

/**
 * @author xujingtao
 */
@Component
public class ProductFeignClientFallback implements ProductFeignClient {

    @Override
    public Product getProductById(Long id) {
        System.out.println("兜底回调");
        Product product = new Product();
        product.setId(id);
        product.setPrice(new BigDecimal(99));
        product.setProductName("商品不存在");
        product.setNum(2);
        return product;
    }
}
